using System;
using UnityEngine;

[Serializable]
public class crossmarket : MonoBehaviour
{
	public AudioClip clip;

	public Color pressed;

	public Color unpressed;

	public GameObject parts;

	public GameObject bg;

	public GameObject attack;

	public GameObject @base;

	public GameObject chip;

	public GameObject disk;

	public GameObject ripcord;

	public GameObject prebuilt;

	public Collider cross;

	public Camera mainCamera;

	public Camera textcam;

	public GameObject showAds;

	private PartMarket partSelect;

	private marketButtons3D marketButtons;

	public void Start()
	{
		partSelect = (((PartMarket)UnityEngine.Object.FindObjectOfType(typeof(PartMarket))) as PartMarket);
		marketButtons = (((marketButtons3D)UnityEngine.Object.FindObjectOfType(typeof(marketButtons3D))) as marketButtons3D);
	}

	public void Update()
	{
		if (Input.GetMouseButtonUp(0))
		{
			st();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit hitInfo = default(RaycastHit);
			if (Physics.Raycast(mainCamera.ScreenPointToRay(UnityEngine.Input.mousePosition), out hitInfo, 100f) && hitInfo.collider.name == "Cross")
			{
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				cross.GetComponent<Renderer>().material.color = pressed;
				cross.GetComponent<Renderer>().material.SetColor("_SpecColor", pressed);
				attack.SetActiveRecursively(state: false);
				@base.SetActiveRecursively(state: false);
				chip.SetActiveRecursively(state: false);
				disk.SetActiveRecursively(state: false);
				ripcord.SetActiveRecursively(state: false);
				prebuilt.SetActiveRecursively(state: false);
				bg.SetActiveRecursively(state: false);
				partSelect.NEE.SetActiveRecursively(state: false);
				partSelect.buypart.SetActiveRecursively(state: false);
				marketButtons.buyHud.SetActiveRecursively(state: false);
				UnityEngine.Object.Instantiate(showAds);
			}
		}
	}

	public void st()
	{
		cross.GetComponent<Renderer>().material.color = unpressed;
		cross.GetComponent<Renderer>().material.SetColor("_SpecColor", Color.white);
	}

	public void Main()
	{
	}
}
